<%@page import="com.grom.service.SecurityService"%>
<%@page import="com.grom.po.Security"%>
<%@page import="com.grom.util.SecurityUtil"%>
<%@page import="com.grom.po.GcmsUser"%>
<%@page import="java.util.List"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html ng-app="app">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" type="text/css" href="<%=request.getContextPath() %>/js/themes/default/easyui.css">
<link rel="stylesheet" type="text/css" href="<%=request.getContextPath() %>/js/themes/icon.css">
<script type="text/javascript" src="<%=request.getContextPath() %>/js/jquery-1.6.min.js"></script>
<script type="text/javascript" src="<%=request.getContextPath() %>/js/jquery.easyui.min.js"></script>
<script src="http://cdn.bootcss.com/angular.js/1.0.8/angular.min.js"></script>
<link href="http://cdn.bootcss.com/bootstrap/3.1.1/css/bootstrap.css" rel="stylesheet">
<link href="<%=request.getContextPath() %>/js/lib/angular-xeditable/css/xeditable.css" rel="stylesheet">
<script src="<%=request.getContextPath() %>/js/lib/angular-xeditable/js/xeditable.js"></script>
<script src="<%=request.getContextPath() %>/js/security/app.js"></script>
</head>
<body>
	<h2>用户权限管理</h2>
<div ng-controller="EditableRowCtrl">
  <input type="text" ng-model="search" class="form-control search-query" placeholder="Search">
  <table class="table table-bordered table-hover table-condensed">
    <tr style="font-weight: bold">
      <td style="width:35%">ID</td>
      <td style="width:20%">Name</td>
      <td style="width:20%">URL</td>
      <td style="width:25%">ParentId</td>
	  <td style="width:25%">action</td>
    </tr>
    <tr ng-repeat="sec in securitys | filter:search">
      <td>
        <!-- editable username (text with validation) -->
        <span editable-text="sec.ID" e-name="ID" e-form="rowform" e-required>
          {{ sec.ID || 'empty' }}
        </span>
      </td>
      <td>
        <!-- editable status (select-local) -->
        <span editable-text="sec.securityName" e-name="securityName" e-form="rowform" >
          {{ sec.securityName }}
        </span>
      </td>
      <td>
        <!-- editable group (select-remote) -->
        <span editable-text="sec.actionUrl" e-name="actionUrl" e-form="rowform" >
          {{ sec.actionUrl }}
        </span>
      </td>
	  <td>
        <!-- editable group (select-remote) -->
        <span editable-text="sec.parentID" e-name="parentID" e-form="rowform" >
          {{ sec.parentID }}
        </span>
      </td>
      <td style="white-space: nowrap">
        <!-- form -->
        <form editable-form name="rowform" onbeforesave="saveSecurity($data, sec.ID)" ng-show="rowform.$visible" class="form-buttons form-inline" shown="inserted == sec">
          <button type="submit" ng-disabled="rowform.$waiting" class="btn btn-primary">
            save
          </button>
          <button type="button" ng-disabled="rowform.$waiting" ng-click="rowform.$cancel()" class="btn btn-default">
            cancel
          </button>
        </form>
        <div class="buttons" ng-show="!rowform.$visible">
          <button class="btn btn-primary" ng-click="rowform.$show()">edit</button>
          <button class="btn btn-danger" ng-click="removeSecurity($index)">del</button>
        </div>  
      </td>
    </tr>
  </table>

  <button class="btn btn-default" ng-click="addSecurity()">Add row</button>
</div>
	










</body>
</html>